public class Practice {
	public static void main (String args[]) {
		int sum = 0;
		jiecheng A = new jiecheng();
		for(int i=1;i<=10;i++) {
			A.setX(i);
			sum += A.getResult();
		}
		System.out.println("sum:"+sum);
	}
}




class jiecheng {
	int x;
	int result = 1;
	void setX(int c) {
		result = 1;
		if (c>0) x = c;
		else System.out.println("Illegal call");
	}
	int getResult() {
		int i = 1;
		for (i=1;i<=x;i++) {
			result *= i;
		}
		return result;
	}
}
		
